using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Input;
using FlatRedBall.AI.Pathfinding;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Graphics.Particle;
using FlatRedBall.Math.Geometry;
using FlatRedBall.Math.Splines;
using FlatRedBall.Graphics;

#if FRB_XNA || SILVERLIGHT
using Keys = Microsoft.Xna.Framework.Input.Keys;
using Vector3 = Microsoft.Xna.Framework.Vector3;
using Texture2D = Microsoft.Xna.Framework.Graphics.Texture2D;
#endif

namespace WinRos_Xna.Screens
{
	public partial class TitleScreen
	{
        Keyboard keyboard = InputManager.Keyboard;
        Xbox360GamePad controller1 = InputManager.Xbox360GamePads[0];

        Text text = TextManager.AddText("");
        Text intro = TextManager.AddText("");

		public void CustomInitialize()
		{
            SpriteManager.Camera.X = 0;
            SpriteManager.Camera.Y = 0;
            SpriteManager.Camera.Z = 40;

            text.X = -5;
            text.DisplayText = "Press Enter or Start to Continue";
            text.Red = 1;
            text.Green = 1;
            text.Blue = 1;
            text.ColorOperation = ColorOperation.ColorTextureAlpha;

            intro.DisplayText = "This game is a prototype framework to control Ros objects using the WinRos interface.";
            intro.DisplayText += " For now it can only be used for the PC\n and can be navigated with either the ";
            intro.DisplayText += "keyboard or Xbox 360 controller.  Follow the prompts and have fun!";

            intro.X = SpriteManager.Camera.AbsoluteLeftXEdgeAt(0);
            intro.Y = SpriteManager.Camera.AbsoluteBottomYEdgeAt(0) + 4;
		}

		public void CustomActivity(bool firstTimeCalled)
		{
            if ((int)TimeManager.CurrentTime % 2 == 0)
            {
                text.Red = 0;
                text.Green = 0;
                text.Blue = 0;
            }
            else
            {
                text.Red = 1;
                text.Green = 1;
                text.Blue = 1;
            }

            if (keyboard.KeyDown(Keys.Enter) || controller1.ButtonPushed(Xbox360GamePad.Button.Start))
            {
                MoveToScreen(typeof(WinRos_Xna.Screens.IPscreen).FullName);
            }

		}

		public void CustomDestroy()
		{

            TextManager.RemoveText(text);
            TextManager.RemoveText(intro);
		}

        private static void CustomLoadStaticContent(string contentManagerName)
        {


        }

	}
}
